package com.lykj.modules.shop.wrapper;

import com.lykj.core.mp.support.BaseEntityWrapper;
import com.lykj.core.tool.utils.BeanUtil;
import com.lykj.modules.shop.entity.UserBonus;
import com.lykj.modules.shop.vo.UserBonusVO;

import java.util.Objects;

/**
 * 红包表包装类,返回视图层所需的字段
 *
 * @author cxl
 * @since 2022-01-14
 */
public class UserBonusWrapper extends BaseEntityWrapper<UserBonus, UserBonusVO> {

	public static UserBonusWrapper build() {
		return new UserBonusWrapper();
	}

	@Override
	public UserBonusVO entityVO(UserBonus userBonus) {
		UserBonusVO userBonusVO = Objects.requireNonNull(BeanUtil.copy(userBonus, UserBonusVO.class));

		//User createUser = UserCache.getUser(userBonus.getCreateUser());
		//User updateUser = UserCache.getUser(userBonus.getUpdateUser());
		//userBonusVO.setCreateUserName(createUser.getName());
		//userBonusVO.setUpdateUserName(updateUser.getName());

		return userBonusVO;
	}

}
